﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nop.Core.Tests
{
    public class PageList<T>
    {
        public int TotalCount { get; set; }
        public int PageSize { get; set; }
        public int TotalPages { get; set; }

        public PageList(IEnumerable<T> source, int pageSize)
        {
            TotalCount = source.Count();
            PageSize = pageSize;
            TotalPages = TotalCount / pageSize;

            if (TotalCount % pageSize > 0)
                TotalPages++;
        }
    }

    class TestSample
    {
        public void Test1()
        {
            var s1 = new List<string>();
            s1.Add("a");
            s1.Add("b");

            var s2 = s1.Except(null);

        }

        public void Test2()
        {
            var s1 = new List<string>();
            s1.Add("a");
            s1.Add("b");
            s1.Add("b");
            s1.Add("b");
            s1.Add("b");

            var p = new PageList<string>(s1, 2);


        }
    }
}
